<c:if test="${orderValidated == true}">            
    <div class="alert alert-success">Your order is successfully done.</div>
</c:if>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">Order summary</h3>
    </div>
    <div class="panel-body">
        <div class="col-md-6">
            <form method="post" action="" class="form-horizontal">
                <fieldset>
                    <table>
                        <tr>
                            <td>
                                <div class="form-group">
                                    <label class="control-label col-sm-2">Nom</label>
                                    <div class="col-sm-7">
                                        <input type="text" class="form-control" size="60" value="${user.firstname} ${user.lastname}" disabled/>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="form-group">
                                    <label class="control-label col-sm-2" for="address">Email</label>
                                    <div class="col-sm-7">
                                        <input type="text" class="form-control" size="60" value="${user.email}" disabled/>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="form-group ${empty errors['phone'] ? '': 'has-error'}">
                                    <label class="control-label col-sm-2" for="phone">Phone</label>
                                    <div class="col-sm-7">
                                        <input type="text" id="phone" name="phone" class="form-control" maxlength="45" size="60" placeholder="Type your phone number" value="${(empty phone) ? user.phone : phone}"/>
                                        <c:if test="${!empty errors['phone']}">
                                            <span class="help-block">${empty errors['phone'] ? 'Success': errors['phone']}</span>
                                        </c:if>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="form-group ${empty errors['address'] ? '': 'has-error'}">
                                    <label class="control-label col-sm-2" for="address">Address</label>
                                    <div class="col-sm-7">
                                        <textarea id="adress" name="address" class="form-control" placeholder="Type your address" size="60">${(empty address) ? user.address : address}</textarea>
                                        <c:if test="${!empty errors['address']}">
                                            <span class="help-block">${empty errors['address'] ? 'Success': errors['address']}</span>
                                        </c:if>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="form-group">
                                    <div class="col-sm-offset-3 col-sm-2">
                                        <input type="submit" class="btn btn-primary" value="Set">
                                    </div>
                                </div>      
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </form>
        </div>
    </div>
</div>


<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title">Orders list</h3>
    </div>
    <div class="panel-body">
        <table class="table table-striped">
            <thead>
                <tr>
                    <td class="col-md-2">Order number</td>
                    <td class="col-md-6">Confirmation number</td>
                    <td class="col-md-4">Date</td>
                </tr>        
            </thead>
            <c:forEach items="${listCustomerOrder}" var="customerOrder" varStatus="i">
                <tr>
                    <td>
                        <a href="ordersummary?idOrder=<c:out value="${customerOrder.id}"/>"><b><c:out value="${customerOrder.id}"/></b></a>
                    </td>
                    <td>
                        <a href="ordersummary?idOrder=<c:out value="${customerOrder.id}"/>"><b><c:out value="${customerOrder.confirmationNumber}"/></b></a>
                    </td>
                    <td>
                        <a href="ordersummary?idOrder=<c:out value="${customerOrder.id}"/>"><b><c:out value="${listOrderDate[i.index]}"/></b></a>
                    </td>
                </tr></a>
            </c:forEach>
        </table>
    </div>
</div>